const { defineConfig } = require('@vue/cli-service')

const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
module.exports = defineConfig({
  configureWebpack: config => {
    const plugins = []
    plugins.push(new NodePolyfillPlugin())
  },
  transpileDependencies: true,
  devServer: {
    port: 9999,  //vue项目访问端口
      proxy: {
        "/api": { // 1
          target: 'http://127.0.0.1:8888',   // 2
          changeOrigin: true, // 3
          pathRewrite: {
            '^/api': '/' // 4
          }
        }
      }
    }
})